---
layout: "default"
title: "_ArrayProtocol"
description: "Swift documentation for protocol '_ArrayProtocol'."
keywords: "_ArrayProtocol,protocol,swift,documentation,+=,append,append,dropFirst,dropLast,filter,forEach,insert,insert,makeIterator,map,prefix,prefix,prefix,remove,removeAll,removeFirst,removeFirst,removeSubrange,replaceSubrange,reserveCapacity,split,suffix,suffix,capacity,count,isEmpty,first,endIndex,startIndex,underestimatedCount,Element,Iterator,SubSequence,Index"
root: "/v3.0"
---

<div class="intro-declaration"><code class="language-swift">protocol _ArrayProtocol</code></div>


<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<code class="inherits">ArrayLiteralConvertible, Collection, Indexable, RangeReplaceableCollection, Sequence</code>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>

<tr>
<th id="aliases">Associated Types</th>
<td>
<span id="aliasesmark"></span>
<div class="declaration inherited">
<code class="language-swift">Element</code>
</div>
<div class="declaration inherited">
<code class="language-swift">Iterator : IteratorProtocol = IndexingIterator&lt;Self&gt;</code>
<div class="comment">
    <p>A type that provides the sequence&#39;s iteration interface and
encapsulates its iteration state.</p>

<p>By default, a <code>Collection</code> satisfies <code>Sequence</code> by
supplying a <code>IndexingIterator</code> as its associated <code>Iterator</code>
type.</p>
</div>
</div>
<div class="declaration inherited">
<code class="language-swift">SubSequence : Indexable, Sequence = Slice&lt;Self&gt;</code>
<div class="comment">
    <p>A <code>Sequence</code> that can represent a contiguous subrange of <code>self</code>&#39;s
elements.</p>

<p><strong>Note:</strong> This associated type appears as a requirement in
  <code>Sequence</code>, but is restated here with stricter
  constraints: in a <code>Collection</code>, the <code>SubSequence</code> should
  also be a <code>Collection</code>.</p>
</div>
</div>
<div class="declaration inherited">
<code class="language-swift">Index : ForwardIndex</code>
<div class="comment">
    <p>A type that represents a valid position in the collection.</p>

<p>Valid indices consist of the position of every element and a
&quot;past the end&quot; position that&#39;s not valid for use as a subscript.</p>
</div>
</div>
</td>
</tr>


<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>


<h3>Initializers</h3>
<div class="declaration" id="init_">
<a class="toggle-link" data-toggle="collapse" href="#comment-init_">init(<wbr>_:)</a><div class="comment collapse" id="comment-init_"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">init(_ buffer: Self._Buffer)</code>

        <h4>Declared In</h4>
            <a href="../../protocol/_ArrayProtocol/"><code>_ArrayProtocol</code></a>
        ,    <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="init-arrayliteral_">
<a class="toggle-link" data-toggle="collapse" href="#comment-init-arrayliteral_">init(<wbr>arrayLiteral:)</a> <span class="required">Required</span><div class="comment collapse" id="comment-init-arrayliteral_"><div class="p">
    <p>Create an instance initialized with <code>elements</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">init(arrayLiteral elements: Self.Element...)</code>

        <h4>Declared In</h4>
            <a href="../../protocol/ArrayLiteralConvertible/"><code>ArrayLiteralConvertible</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="init">
<a class="toggle-link" data-toggle="collapse" href="#comment-init">init()</a> <span class="required">Required</span><div class="comment collapse" id="comment-init"><div class="p">
    <p>Create an empty instance.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">init()</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="init-repeating_count_">
<a class="toggle-link" data-toggle="collapse" href="#comment-init-repeating_count_">init(<wbr>repeating:<wbr>count:)</a><div class="comment collapse" id="comment-init-repeating_count_"><div class="p">
    <p>Construct a Collection of <code>count</code> elements, each initialized to
<code>repeatedValue</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">init(repeating repeatedValue: Self.Iterator.Element, count: Int)</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        </div></div>
</div>


<h3>Instance Variables</h3>
<div class="declaration" id="var-capacity_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-capacity_-int">var capacity: Int</a> <span class="required">Required</span><div class="comment collapse" id="comment-var-capacity_-int"><div class="p">
    <p>The number of elements the Array can store without reallocation.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var capacity: Int { get }</code>

    </div></div>
</div>
<div class="declaration" id="var-count_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-count_-int">var count: Int</a><div class="comment collapse" id="comment-var-count_-int"><div class="p">
    <p>The number of elements the Array stores.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var count: Int { get }</code>

    </div></div>
</div>
<div class="declaration" id="var-isempty_-bool">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-isempty_-bool">var isEmpty: Bool</a><div class="comment collapse" id="comment-var-isempty_-bool"><div class="p">
    <p><code>true</code> if and only if the Array is empty.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var isEmpty: Bool { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/_ArrayProtocol/"><code>_ArrayProtocol</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="var-first_-self-iterator-element">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-first_-self-iterator-element">var first: Self.Iterator.Element?</a><div class="comment collapse" id="comment-var-first_-self-iterator-element"><div class="p">
    <p>Returns the first element of <code>self</code>, or <code>nil</code> if <code>self</code> is empty.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var first: Self.Iterator.Element? { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="var-endindex_-self-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-endindex_-self-index">var endIndex: Self.Index</a> <span class="required">Required</span><div class="comment collapse" id="comment-var-endindex_-self-index"><div class="p">
    <p>The collection&#39;s &quot;past the end&quot; position.</p>

<p><code>endIndex</code> is not a valid argument to <code>subscript</code>, and is always
reachable from <code>startIndex</code> by zero or more applications of
<code>successor()</code>.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var endIndex: Self.Index { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/Indexable/"><code>Indexable</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="var-startindex_-self-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-startindex_-self-index">var startIndex: Self.Index</a> <span class="required">Required</span><div class="comment collapse" id="comment-var-startindex_-self-index"><div class="p">
    <p>The position of the first element in a non-empty collection.</p>

<p>In an empty collection, <code>startIndex == endIndex</code>.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var startIndex: Self.Index { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/Indexable/"><code>Indexable</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="var-underestimatedcount_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-underestimatedcount_-int">var underestimatedCount: Int</a><div class="comment collapse" id="comment-var-underestimatedcount_-int"><div class="p">
    <p>Returns a value less than or equal to the number of elements in
<code>self</code>, <strong>nondestructively</strong>.</p>

<p><strong>Complexity:</strong> O(N).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var underestimatedCount: Int { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/Sequence/"><code>Sequence</code></a>
        </div></div>
</div>

<h3>Subscripts</h3>
<div class="declaration" id="subscript-subscript_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment-subscript-subscript_-int">subscript(_: Int)</a> <span class="required">Required</span>
<div class="comment collapse" id="comment-subscript-subscript_-int"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">subscript(index: Int) -&gt; Self.Iterator.Element { get set }</code>
    
    
</div></div>
</div>
<div class="declaration inherited" id="subscript-subscript_-self-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-subscript-subscript_-self-index">subscript(_: Self.Index)</a> <span class="required">Required</span>
<div class="comment collapse" id="comment-subscript-subscript_-self-index"><div class="p">
    <p>Returns the element at the given <code>position</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">subscript(position: Self.Index) -&gt; Self.Iterator.Element { get }</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Indexable/"><code>Indexable</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="subscript-subscript_-range-self-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-subscript-subscript_-range-self-index">subscript(_: Range&lt;Self.Index&gt;)</a> <span class="required">Required</span>
<div class="comment collapse" id="comment-subscript-subscript_-range-self-index"><div class="p">
    <p>Returns a collection representing a contiguous sub-range of
<code>self</code>&#39;s elements.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">subscript(bounds: Range&lt;Self.Index&gt;) -&gt; Self.SubSequence { get }</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>


<h3>Instance Methods</h3>
<div class="declaration" id="func-plseq_rhs_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq_rhs_">func +=(<wbr>_:<wbr>rhs:)</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func-plseq_rhs_"><div class="p">
    <p>Operator form of <code>append(contentsOf:)</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;S : Sequence where S.Iterator.Element == Iterator.Element&gt;(lhs: inout Self, rhs: S)</code>
    
    
</div></div>
</div>
<div class="declaration inherited" id="func-append_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-append_">mutating func append(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-append_"><div class="p">
    <p>Append <code>x</code> to <code>self</code>.</p>

<p>Applying <code>successor()</code> to the index of the new element yields
<code>self.endIndex</code>.</p>

<p><strong>Complexity:</strong> Amortized O(1).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func append(x: Self.Iterator.Element)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-append-contentsof_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-append-contentsof_">mutating func append(<wbr>contentsOf:)</a>
        
<div class="comment collapse" id="comment-func-append-contentsof_"><div class="p">
    <p>Append the elements of <code>newElements</code> to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<em>length of result</em>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func append&lt;S : Sequence where S.Iterator.Element == Iterator.Element&gt;(contentsOf newElements: S)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-dropfirst_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-dropfirst_">func dropFirst(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-dropfirst_"><div class="p">
    <p>Returns a subsequence containing all but the first <code>n</code> elements.</p>

<p><strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>n</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropFirst(n: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-droplast_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-droplast_">func dropLast(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-droplast_"><div class="p">
    <p>Returns a subsequence containing all but the last <code>n</code> elements.</p>

<p><strong>Precondition:</strong> <code>self</code> is a finite sequence.
<strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>self.count</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropLast(n: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-filter_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-filter_">func filter(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-filter_"><div class="p">
    <p>Returns an <code>Array</code> containing the elements of <code>self</code>,
in order, that satisfy the predicate <code>includeElement</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func filter(@noescape includeElement: (Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; [Self.Iterator.Element]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-foreach_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-foreach_">func forEach(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-foreach_"><div class="p">
    <p>Call <code>body</code> on each element in <code>self</code> in the same order as a
<em>for-in loop.</em></p>

<pre><code class="language-swift">sequence.forEach {
  // body code
}</code></pre>

<p>is similar to:</p>

<pre><code class="language-swift">for element in sequence {
  // body code
}</code></pre>

<p><strong>Note:</strong> You cannot use the <code>break</code> or <code>continue</code> statement to exit the
  current call of the <code>body</code> closure or skip subsequent calls.
<strong>Note:</strong> Using the <code>return</code> statement in the <code>body</code> closure will only
  exit from the current call to <code>body</code>, not any outer scope, and won&#39;t
  skip subsequent calls.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func forEach(@noescape body: (Self.Iterator.Element) throws -&gt; Swift.Void) rethrows</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration" id="func-insert_at_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-insert_at_">mutating func insert(<wbr>_:<wbr>at:)</a>
        
<div class="comment collapse" id="comment-func-insert_at_"><div class="p">
    <p>Insert <code>newElement</code> at index <code>i</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

<p><strong>Precondition:</strong> <code>i &lt;= count</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func insert(newElement: Self.Iterator.Element, at i: Int)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/_ArrayProtocol/"><code>_ArrayProtocol</code></a>,    <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-insert-contentsof_at_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-insert-contentsof_at_">mutating func insert(<wbr>contentsOf:<wbr>at:)</a>
        
<div class="comment collapse" id="comment-func-insert-contentsof_at_"><div class="p">
    <p>Insert <code>newElements</code> at index <code>i</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>self.count + newElements.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func insert&lt;S : Collection where S.Iterator.Element == Iterator.Element&gt;(contentsOf newElements: S, at i: Self.Index)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-makeiterator">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-makeiterator">func makeIterator()</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func-makeiterator"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func makeIterator() -&gt; Self.Iterator</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-map_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-map_">func map(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-map_"><div class="p">
    <p>Returns an <code>Array</code> containing the results of mapping <code>transform</code>
over <code>self</code>.</p>

<p><strong>Complexity:</strong> O(N).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func map&lt;T&gt;(@noescape transform: (Self.Iterator.Element) throws -&gt; T) rethrows -&gt; [T]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-prefix_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-prefix_">func prefix(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-prefix_"><div class="p">
    <p>Returns a subsequence, up to <code>maxLength</code> in length, containing the
initial elements.</p>

<p>If <code>maxLength</code> exceeds <code>self.count</code>, the result contains all
the elements of <code>self</code>.</p>

<p><strong>Precondition:</strong> <code>maxLength &gt;= 0</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func prefix(maxLength: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-prefix-through_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-prefix-through_">func prefix(<wbr>through:)</a>
        
<div class="comment collapse" id="comment-func-prefix-through_"><div class="p">
    <p>Returns <code>prefix(upTo: position.successor())</code></p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func prefix(through position: Self.Index) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-prefix-upto_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-prefix-upto_">func prefix(<wbr>upTo:)</a>
        
<div class="comment collapse" id="comment-func-prefix-upto_"><div class="p">
    <p>Returns <code>self[startIndex..&lt;end]</code></p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func prefix(upTo end: Self.Index) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration" id="func-remove-at_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-remove-at_">mutating func remove(<wbr>at:)</a>
        
<div class="comment collapse" id="comment-func-remove-at_"><div class="p">
    <p>Remove and return the element at the given index.</p>

<p><strong>returns:</strong> The removed element.</p>

<p><strong>Complexity:</strong> Worst case O(N).</p>

<p><strong>Precondition:</strong> <code>count &gt; index</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func remove(at index: Int) -&gt; Self.Iterator.Element</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/_ArrayProtocol/"><code>_ArrayProtocol</code></a>,    <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-removeall-keepingcapacity_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-removeall-keepingcapacity_">mutating func removeAll(<wbr>keepingCapacity:)</a>
        
<div class="comment collapse" id="comment-func-removeall-keepingcapacity_"><div class="p">
    <p>Remove all elements.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong><code>keepCapacity</code>:</strong>  If <code>true</code>, is a non-binding request to
   avoid releasing storage, which can be a useful optimization
   when <code>self</code> is going to be grown again.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeAll(keepingCapacity keepCapacity: Bool)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-removefirst">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-removefirst">mutating func removeFirst()</a>
        
<div class="comment collapse" id="comment-func-removefirst"><div class="p">
    <p>Remove the element at <code>startIndex</code> and return it.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>)
<strong>Precondition:</strong> <code>!self.isEmpty</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeFirst() -&gt; Self.Iterator.Element</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-removefirst_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-removefirst_">mutating func removeFirst(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-removefirst_"><div class="p">
    <p>Remove the first <code>n</code> elements.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>)
<strong>Precondition:</strong> <code>n &gt;= 0 &amp;&amp; self.count &gt;= n</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeFirst(n: Int)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-removesubrange_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-removesubrange_">mutating func removeSubrange(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-removesubrange_"><div class="p">
    <p>Remove all elements within <code>bounds</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeSubrange(bounds: Range&lt;Self.Index&gt;)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-replacesubrange_with_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-replacesubrange_with_">mutating func replaceSubrange(<wbr>_:<wbr>with:)</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func-replacesubrange_with_"><div class="p">
    <p>Replace the given <code>subRange</code> of elements with <code>newElements</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>subRange.count</code>) if
  <code>subRange.endIndex == self.endIndex</code> and <code>newElements.isEmpty</code>,
  O(<code>self.count</code> + <code>newElements.count</code>) otherwise.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func replaceSubrange&lt;C : Collection where C.Iterator.Element == Iterator.Element&gt;(subRange: Range&lt;Self.Index&gt;, with newElements: C)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration" id="func-reservecapacity_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-reservecapacity_">mutating func reserveCapacity(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-reservecapacity_"><div class="p">
    <p>Reserve enough space to store minimumCapacity elements.</p>

<p><strong>Postcondition:</strong> <code>capacity &gt;= minimumCapacity</code> and the array has
  mutable contiguous storage.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func reserveCapacity(minimumCapacity: Int)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/_ArrayProtocol/"><code>_ArrayProtocol</code></a>,    <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-split-maxsplits_omittingemptysubsequences_isseparator_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-split-maxsplits_omittingemptysubsequences_isseparator_">func split(<wbr>maxSplits:<wbr>omittingEmptySubsequences:<wbr>isSeparator:)</a>
        
<div class="comment collapse" id="comment-func-split-maxsplits_omittingemptysubsequences_isseparator_"><div class="p">
    <p>Returns the maximal <code>SubSequence</code>s of <code>self</code>, in order, that
don&#39;t contain elements satisfying the predicate <code>isSeparator</code>.</p>

<p><strong><code>maxSplits</code>:</strong>  The maximum number of <code>SubSequence</code>s to
  return, minus 1.
  If <code>maxSplits + 1</code> <code>SubSequence</code>s are returned, the last one is
  a suffix of <code>self</code> containing <em>all</em> the elements of <code>self</code> following the
  last split point.
  The default value is <code>Int.max</code>.</p>

<p><strong><code>omittingEmptySubsequences</code>:</strong>  If <code>false</code>, an empty <code>SubSequence</code>
  is produced in the result for each pair of consecutive elements
  satisfying <code>isSeparator</code>.
  The default value is <code>true</code>.</p>

<p><strong>Precondition:</strong> <code>maxSplits &gt;= 0</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func split(maxSplits maxSplits: Int, omittingEmptySubsequences: Bool, @noescape isSeparator: (Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; [Self.SubSequence]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-suffix_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-suffix_">func suffix(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-suffix_"><div class="p">
    <p>Returns a slice, up to <code>maxLength</code> in length, containing the
final elements of <code>s</code>.</p>

<p>If <code>maxLength</code> exceeds <code>s.count</code>, the result contains all
the elements of <code>s</code>.</p>

<p><strong>Precondition:</strong> <code>self</code> is a finite sequence.
<strong>Precondition:</strong> <code>maxLength &gt;= 0</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func suffix(maxLength: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-suffix-from_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-suffix-from_">func suffix(<wbr>from:)</a>
        
<div class="comment collapse" id="comment-func-suffix-from_"><div class="p">
    <p>Returns <code>self[start..&lt;endIndex]</code></p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func suffix(from start: Self.Index) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>


<h3>Default Implementations</h3>




<div class="declaration inherited" id="-init_">
<a class="toggle-link" data-toggle="collapse" href="#comment--init_">init(<wbr>_:)</a><div class="comment collapse" id="comment--init_"><div class="p">
    <p>Creates a collection instance that contains <code>elements</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">init&lt;S : Sequence where S.Iterator.Element == Iterator.Element&gt;(_ elements: S)</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="-init-repeating_count_">
<a class="toggle-link" data-toggle="collapse" href="#comment--init-repeating_count_">init(<wbr>repeating:<wbr>count:)</a><div class="comment collapse" id="comment--init-repeating_count_"><div class="p">
    <p>Construct a Collection of <code>count</code> elements, each initialized to
<code>repeatedValue</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">init(repeating repeatedValue: Self.Iterator.Element, count: Int)</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        </div></div>
</div>

<div class="declaration inherited" id="-var-count_-self-index-distance">
<a class="toggle-link" data-toggle="collapse" href="#comment--var-count_-self-index-distance">var count: Self.Index.Distance</a><div class="comment collapse" id="comment--var-count_-self-index-distance"><div class="p">
    <p>Returns the number of elements.</p>

<p><strong>Complexity:</strong> O(1) if <code>Index</code> conforms to <code>RandomAccessIndex</code>;
  O(N) otherwise.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var count: Self.Index.Distance { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="-var-first_-self-iterator-element">
<a class="toggle-link" data-toggle="collapse" href="#comment--var-first_-self-iterator-element">var first: Self.Iterator.Element?</a><div class="comment collapse" id="comment--var-first_-self-iterator-element"><div class="p">
    <p>Returns the first element of <code>self</code>, or <code>nil</code> if <code>self</code> is empty.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var first: Self.Iterator.Element? { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="-var-indices_-range-self-index">
<a class="toggle-link" data-toggle="collapse" href="#comment--var-indices_-range-self-index">var indices: Range&lt;Self.Index&gt;</a><div class="comment collapse" id="comment--var-indices_-range-self-index"><div class="p">
    <p>Returns the range of valid index values.</p>

<p>The result&#39;s <code>endIndex</code> is the same as that of <code>self</code>.  Because
<code>Range</code> is half-open, iterating the values of the result produces
all valid subscript arguments for <code>self</code>, omitting its <code>endIndex</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var indices: Range&lt;Self.Index&gt; { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="-var-isempty_-bool">
<a class="toggle-link" data-toggle="collapse" href="#comment--var-isempty_-bool">var isEmpty: Bool</a><div class="comment collapse" id="comment--var-isempty_-bool"><div class="p">
    <p>Default implementations of core requirements
Returns <code>true</code> iff <code>self</code> is empty.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var isEmpty: Bool { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="-var-lazy_-lazycollection-self">
<a class="toggle-link" data-toggle="collapse" href="#comment--var-lazy_-lazycollection-self">var lazy: LazyCollection&lt;Self&gt;</a><div class="comment collapse" id="comment--var-lazy_-lazycollection-self"><div class="p">
    <p>Augment <code>self</code> with lazy methods such as <code>map</code>, <code>filter</code>, etc.
A collection with contents identical to <code>self</code>, but on which
normally-eager operations such as <code>map</code> and <code>filter</code> are
implemented lazily.</p>

<p><strong>See Also:</strong> <code>LazySequenceProtocol</code>, <code>LazyCollectionProtocol</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var lazy: LazyCollection&lt;Self&gt; { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>
<div class="declaration inherited" id="-var-underestimatedcount_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment--var-underestimatedcount_-int">var underestimatedCount: Int</a><div class="comment collapse" id="comment--var-underestimatedcount_-int"><div class="p">
    <p>Returns a value less than or equal to the number of elements in
<code>self</code>, <em>nondestructively</em>.</p>

<p><strong>Complexity:</strong> O(<code>count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var underestimatedCount: Int { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        ,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>
        </div></div>
</div>


<div class="declaration inherited" id="func--append_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--append_">mutating func append(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--append_"><div class="p">
    <p>Append <code>x</code> to <code>self</code>.</p>

<p>Applying <code>successor()</code> to the index of the new element yields
<code>self.endIndex</code>.</p>

<p><strong>Complexity:</strong> Amortized O(1).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func append(newElement: Self.Iterator.Element)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--append-contentsof_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--append-contentsof_">mutating func append(<wbr>contentsOf:)</a>
        
<div class="comment collapse" id="comment-func--append-contentsof_"><div class="p">
    <p>Append the elements of <code>newElements</code> to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<em>length of result</em>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func append&lt;S : Sequence where S.Iterator.Element == Iterator.Element&gt;(contentsOf newElements: S)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--contains_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--contains_">func contains(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--contains_"><div class="p">
    <p>Returns <code>true</code> iff an element in <code>self</code> satisfies <code>predicate</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func contains(@noescape predicate: (Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--dropfirst">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--dropfirst">func dropFirst()</a>
        
<div class="comment collapse" id="comment-func--dropfirst"><div class="p">
    <p>Returns a subsequence containing all but the first element.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropFirst() -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--dropfirst_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--dropfirst_">func dropFirst(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--dropfirst_"><div class="p">
    <p>Returns a subsequence containing all but the first <code>n</code> elements.</p>

<p><strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>n</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropFirst(n: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--droplast">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--droplast">func dropLast()</a>
        
<div class="comment collapse" id="comment-func--droplast"><div class="p">
    <p>Returns a subsequence containing all but the last element.</p>

<p><strong>Precondition:</strong> <code>self</code> is a finite sequence.
<strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>self.count</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropLast() -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--droplast_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--droplast_">func dropLast(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--droplast_"><div class="p">
    <p>Returns a subsequence containing all but the last <code>n</code> elements.</p>

<p><strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>self.count</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropLast(n: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--elementsequal_isequivalent_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--elementsequal_isequivalent_">func elementsEqual(<wbr>_:<wbr>isEquivalent:)</a>
        
<div class="comment collapse" id="comment-func--elementsequal_isequivalent_"><div class="p">
    <p>Returns <code>true</code> iff <code>self</code> and <code>other</code> contain equivalent elements, using
<code>isEquivalent</code> as the equivalence test.</p>

<p><strong>Precondition:</strong> <code>isEquivalent</code> is an
  <a href="http://en.wikipedia.org/wiki/Equivalence_relation">equivalence relation</a>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func elementsEqual&lt;OtherSequence : Sequence where OtherSequence.Iterator.Element == Iterator.Element&gt;(other: OtherSequence, @noescape isEquivalent: (Self.Iterator.Element, Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--enumerated">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--enumerated">func enumerated()</a>
        
<div class="comment collapse" id="comment-func--enumerated"><div class="p">
    <p>Returns a lazy <code>Sequence</code> containing pairs (<em>n</em>, <em>x</em>), where
<em>n</em>s are consecutive <code>Int</code>s starting at zero, and <em>x</em>s are
the elements of <code>self</code>:</p>

<pre><code class="language-swift">&gt; for (n, c) in &quot;Swift&quot;.characters.enumerated() {
    print(&quot;\(n): &#39;\(c)&#39;&quot;)
  }
0: &#39;S&#39;
1: &#39;w&#39;
2: &#39;i&#39;
3: &#39;f&#39;
4: &#39;t&#39;</code></pre>

    <h4>Declaration</h4>    
    <code class="language-swift">func enumerated() -&gt; EnumeratedSequence&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--filter_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--filter_">func filter(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--filter_"><div class="p">
    <p>Returns an <code>Array</code> containing the elements of <code>self</code>,
in order, that satisfy the predicate <code>includeElement</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func filter(@noescape includeElement: (Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; [Self.Iterator.Element]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--flatmap-t_-self-iterator-element-throws-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--flatmap-t_-self-iterator-element-throws-t">func flatMap&lt;T&gt;(<wbr>_: (Self.Iterator.Element) throws -&gt; T?)</a>
        
<div class="comment collapse" id="comment-func--flatmap-t_-self-iterator-element-throws-t"><div class="p">
    <p>Returns an <code>Array</code> containing the non-nil results of mapping
<code>transform</code> over <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<em>M</em> + <em>N</em>), where <em>M</em> is the length of <code>self</code>
  and <em>N</em> is the length of the result.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func flatMap&lt;T&gt;(@noescape transform: (Self.Iterator.Element) throws -&gt; T?) rethrows -&gt; [T]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--flatmap-s_-sequence_-self-iterator-element-throws-s">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--flatmap-s_-sequence_-self-iterator-element-throws-s">func <wbr>flatMap&lt;S : Sequence&gt;(<wbr>_: (Self.Iterator.Element) throws -&gt; S)</a>
        
<div class="comment collapse" id="comment-func--flatmap-s_-sequence_-self-iterator-element-throws-s"><div class="p">
    <p>Returns an <code>Array</code> containing the concatenated results of mapping
<code>transform</code> over <code>self</code>.</p>

<pre><code class="language-swift">s.flatMap(transform)</code></pre>

<p>is equivalent to</p>

<pre><code class="language-swift">Array(s.map(transform).flatten())</code></pre>

<p><strong>Complexity:</strong> O(<em>M</em> + <em>N</em>), where <em>M</em> is the length of <code>self</code>
  and <em>N</em> is the length of the result.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func flatMap&lt;S : Sequence&gt;(@noescape transform: (Self.Iterator.Element) throws -&gt; S) rethrows -&gt; [S.Iterator.Element]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--foreach_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--foreach_">func forEach(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--foreach_"><div class="p">
    <p>Call <code>body</code> on each element in <code>self</code> in the same order as a
<em>for-in loop.</em></p>

<pre><code class="language-swift">sequence.forEach {
  // body code
}</code></pre>

<p>is similar to:</p>

<pre><code class="language-swift">for element in sequence {
  // body code
}</code></pre>

<p><strong>Note:</strong> You cannot use the <code>break</code> or <code>continue</code> statement to exit the
  current call of the <code>body</code> closure or skip subsequent calls.
<strong>Note:</strong> Using the <code>return</code> statement in the <code>body</code> closure will only
  exit from the current call to <code>body</code>, not any outer scope, and won&#39;t
  skip subsequent calls.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func forEach(@noescape body: (Self.Iterator.Element) throws -&gt; Swift.Void) rethrows</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--index-where_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--index-where_">func index(<wbr> where:)</a>
        
<div class="comment collapse" id="comment-func--index-where_"><div class="p">
    <p>Returns the first index where <code>predicate</code> returns <code>true</code> for the
corresponding value, or <code>nil</code> if such value is not found.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func index(@noescape where predicate: (Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; Self.Index?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--insert_at_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--insert_at_">mutating func insert(<wbr>_:<wbr>at:)</a>
        
<div class="comment collapse" id="comment-func--insert_at_"><div class="p">
    <p>Insert <code>newElement</code> at index <code>i</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func insert(newElement: Self.Iterator.Element, at i: Self.Index)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--insert-contentsof_at_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--insert-contentsof_at_">mutating func insert(<wbr>contentsOf:<wbr>at:)</a>
        
<div class="comment collapse" id="comment-func--insert-contentsof_at_"><div class="p">
    <p>Insert <code>newElements</code> at index <code>i</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>self.count + newElements.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func insert&lt;C : Collection where C.Iterator.Element == Iterator.Element&gt;(contentsOf newElements: C, at i: Self.Index)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--lexicographicallyprecedes_isorderedbefore_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--lexicographicallyprecedes_isorderedbefore_">func lexicographicallyPrecedes(<wbr>_:<wbr>isOrderedBefore:)</a>
        
<div class="comment collapse" id="comment-func--lexicographicallyprecedes_isorderedbefore_"><div class="p">
    <p>Returns <code>true</code> iff <code>self</code> precedes <code>other</code> in a lexicographical 
(&quot;dictionary&quot;) ordering, using <code>isOrderedBefore</code> as the comparison 
between elements.</p>

<p><strong>Note:</strong> This method implements the mathematical notion of lexicographical
  ordering, which has no connection to Unicode.  If you are sorting strings
  to present to the end-user, you should use <code>String</code> APIs that perform
localized comparison.</p>

<p><strong>Precondition:</strong> <code>isOrderedBefore</code> is a
  <a href="http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings">strict weak ordering</a>
  over the elements of <code>self</code> and <code>other</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func lexicographicallyPrecedes&lt;OtherSequence : Sequence where OtherSequence.Iterator.Element == Iterator.Element&gt;(other: OtherSequence, @noescape isOrderedBefore: (Self.Iterator.Element, Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--map_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--map_">func map(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--map_"><div class="p">
    <p>Returns an <code>Array</code> containing the results of mapping <code>transform</code>
over <code>self</code>.</p>

<p><strong>Complexity:</strong> O(N).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func map&lt;T&gt;(@noescape transform: (Self.Iterator.Element) throws -&gt; T) rethrows -&gt; [T]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--max-isorderedbefore_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--max-isorderedbefore_">func max(<wbr> isOrderedBefore:)</a>
        
<div class="comment collapse" id="comment-func--max-isorderedbefore_"><div class="p">
    <p>Returns the maximum element in <code>self</code> or <code>nil</code> if the sequence is empty.</p>

<p><strong>Complexity:</strong> O(<code>elements.count</code>).</p>

<p><strong>Precondition:</strong> <code>isOrderedBefore</code> is a
  <a href="http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings">strict weak ordering</a>
  over <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func max(@noescape isOrderedBefore isOrderedBefore: (Self.Iterator.Element, Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; Self.Iterator.Element?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--min-isorderedbefore_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--min-isorderedbefore_">func min(<wbr> isOrderedBefore:)</a>
        
<div class="comment collapse" id="comment-func--min-isorderedbefore_"><div class="p">
    <p>Returns the minimum element in <code>self</code> or <code>nil</code> if the sequence is empty.</p>

<p><strong>Complexity:</strong> O(<code>elements.count</code>).</p>

<p><strong>Precondition:</strong> <code>isOrderedBefore</code> is a
  <a href="http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings">strict weak ordering</a>
  over <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func min(@noescape isOrderedBefore isOrderedBefore: (Self.Iterator.Element, Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; Self.Iterator.Element?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--prefix_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--prefix_">func prefix(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--prefix_"><div class="p">
    <p>Returns a subsequence, up to <code>maxLength</code> in length, containing the
initial elements.</p>

<p>If <code>maxLength</code> exceeds <code>self.count</code>, the result contains all
the elements of <code>self</code>.</p>

<p><strong>Precondition:</strong> <code>maxLength &gt;= 0</code>
<strong>Complexity:</strong> O(<code>maxLength</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func prefix(maxLength: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--prefix-through_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--prefix-through_">func prefix(<wbr>through:)</a>
        
<div class="comment collapse" id="comment-func--prefix-through_"><div class="p">
    <p>Returns <code>prefix(upTo: position.successor())</code></p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func prefix(through position: Self.Index) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--prefix-upto_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--prefix-upto_">func prefix(<wbr>upTo:)</a>
        
<div class="comment collapse" id="comment-func--prefix-upto_"><div class="p">
    <p>Returns <code>self[startIndex..&lt;end]</code></p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func prefix(upTo end: Self.Index) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--reduce_combine_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--reduce_combine_">func reduce(<wbr>_:<wbr>combine:)</a>
        
<div class="comment collapse" id="comment-func--reduce_combine_"><div class="p">
    <p>Returns the result of repeatedly calling <code>combine</code> with an
accumulated value initialized to <code>initial</code> and each element of
<code>self</code>, in turn, i.e. return
<code>combine(combine(...combine(combine(initial, self[0]),
self[1]),...self[count-2]), self[count-1])</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func reduce&lt;T&gt;(initial: T, @noescape combine: (T, Self.Iterator.Element) throws -&gt; T) rethrows -&gt; T</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--remove-at_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--remove-at_">mutating func remove(<wbr>at:)</a>
        
<div class="comment collapse" id="comment-func--remove-at_"><div class="p">
    <p>Remove the element at index <code>i</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func remove(at index: Self.Index) -&gt; Self.Iterator.Element</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--removeall-keepingcapacity_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--removeall-keepingcapacity_">mutating func removeAll(<wbr>keepingCapacity:)</a>
        
<div class="comment collapse" id="comment-func--removeall-keepingcapacity_"><div class="p">
    <p>Remove all elements.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong><code>keepCapacity</code>:</strong>  If <code>true</code>, is a non-binding request to
   avoid releasing storage, which can be a useful optimization
   when <code>self</code> is going to be grown again.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeAll(keepingCapacity keepCapacity: Bool = default)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--removefirst">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--removefirst">mutating func removeFirst()</a>
        
<div class="comment collapse" id="comment-func--removefirst"><div class="p">
    <p>Remove the element at <code>startIndex</code> and return it.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>)
<strong>Precondition:</strong> <code>!self.isEmpty</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeFirst() -&gt; Self.Iterator.Element</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--removefirst_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--removefirst_">mutating func removeFirst(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--removefirst_"><div class="p">
    <p>Remove the first <code>n</code> elements.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>)
<strong>Precondition:</strong> <code>n &gt;= 0 &amp;&amp; self.count &gt;= n</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeFirst(n: Int)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--removesubrange_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--removesubrange_">mutating func removeSubrange(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--removesubrange_"><div class="p">
    <p>Remove all elements within <code>bounds</code>.</p>

<p>Invalidates all indices with respect to <code>self</code>.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeSubrange(bounds: Range&lt;Self.Index&gt;)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--reservecapacity_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--reservecapacity_">mutating func reserveCapacity(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--reservecapacity_"><div class="p">
    <p>A non-binding request to ensure <code>n</code> elements of available storage.</p>

<p>This works as an optimization to avoid multiple reallocations of
linear data structures like <code>Array</code>.  Conforming types may
reserve more than <code>n</code>, exactly <code>n</code>, less than <code>n</code> elements of
storage, or even ignore the request completely.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func reserveCapacity(n: Self.Index.Distance)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--reversed">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--reversed">func reversed()</a>
        
<div class="comment collapse" id="comment-func--reversed"><div class="p">
    <p>Returns an <code>Array</code> containing the elements of <code>self</code> in reverse
order.</p>

<p>Complexity: O(N), where N is the length of <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func reversed() -&gt; [Self.Iterator.Element]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--sorted-isorderedbefore_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--sorted-isorderedbefore_">func sorted(<wbr> isOrderedBefore:)</a>
        
<div class="comment collapse" id="comment-func--sorted-isorderedbefore_"><div class="p">
    <p>Returns an <code>Array</code> containing the sorted elements of <code>source</code>
according to <code>isOrderedBefore</code>.</p>

<p>The sorting algorithm is not stable (can change the relative order of
elements for which <code>isOrderedBefore</code> does not establish an order).</p>

<p><strong>Precondition:</strong> <code>isOrderedBefore</code> is a
  <a href="http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings">strict weak ordering</a>
  over the elements in <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func sorted(@noescape isOrderedBefore isOrderedBefore: (Self.Iterator.Element, Self.Iterator.Element) -&gt; Bool) -&gt; [Self.Iterator.Element]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--split-maxsplits_omittingemptysubsequences_isseparator_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--split-maxsplits_omittingemptysubsequences_isseparator_">func split(<wbr>maxSplits:<wbr>omittingEmptySubsequences:<wbr>isSeparator:)</a>
        
<div class="comment collapse" id="comment-func--split-maxsplits_omittingemptysubsequences_isseparator_"><div class="p">
    <p>Returns the maximal <code>SubSequence</code>s of <code>self</code>, in order, that
don&#39;t contain elements satisfying the predicate <code>isSeparator</code>.</p>

<p><strong><code>maxSplits</code>:</strong>  The maximum number of <code>SubSequence</code>s to
  return, minus 1.
  If <code>maxSplits + 1</code> <code>SubSequence</code>s are returned, the last one is
  a suffix of <code>self</code> containing <em>all</em> the elements of <code>self</code> following the
  last split point.
  The default value is <code>Int.max</code>.</p>

<p><strong><code>omittingEmptySubsequences</code>:</strong>  If <code>false</code>, an empty <code>SubSequence</code>
  is produced in the result for each pair of consecutive elements
  satisfying <code>isSeparator</code>.
  The default value is <code>true</code>.</p>

<p><strong>Precondition:</strong> <code>maxSplits &gt;= 0</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func split(maxSplits maxSplits: Int = default, omittingEmptySubsequences: Bool = default, @noescape isSeparator: (Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; [Self.SubSequence]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--starts-with_isequivalent_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--starts-with_isequivalent_">func starts(<wbr>with:<wbr>isEquivalent:)</a>
        
<div class="comment collapse" id="comment-func--starts-with_isequivalent_"><div class="p">
    <p>Returns <code>true</code> iff <code>self</code> begins with elements equivalent to those of
<code>other</code>, using <code>isEquivalent</code> as the equivalence test.  Returns <code>true</code> if
<code>other</code> is empty.</p>

<p><strong>Precondition:</strong> <code>isEquivalent</code> is an
  <a href="http://en.wikipedia.org/wiki/Equivalence_relation">equivalence relation</a>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func starts&lt;PossiblePrefix : Sequence where PossiblePrefix.Iterator.Element == Iterator.Element&gt;(with possiblePrefix: PossiblePrefix, @noescape isEquivalent: (Self.Iterator.Element, Self.Iterator.Element) throws -&gt; Bool) rethrows -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--suffix_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--suffix_">func suffix(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func--suffix_"><div class="p">
    <p>Returns a slice, up to <code>maxLength</code> in length, containing the
final elements of <code>self</code>.</p>

<p>If <code>maxLength</code> exceeds <code>s.count</code>, the result contains all
the elements of <code>self</code>.</p>

<p><strong>Precondition:</strong> <code>maxLength &gt;= 0</code>
<strong>Complexity:</strong> O(<code>self.count</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func suffix(maxLength: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func--suffix-from_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--suffix-from_">func suffix(<wbr>from:)</a>
        
<div class="comment collapse" id="comment-func--suffix-from_"><div class="p">
    <p>Returns <code>self[start..&lt;endIndex]</code></p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func suffix(from start: Self.Index) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>







<h4>Where Index : BidirectionalIndex</h4>


<div class="declaration inherited" id="index_-bidirectionalindex-var-last_-self-iterator-element">
<a class="toggle-link" data-toggle="collapse" href="#comment-index_-bidirectionalindex-var-last_-self-iterator-element">var last: Self.Iterator.Element?</a><div class="comment collapse" id="comment-index_-bidirectionalindex-var-last_-self-iterator-element"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">var last: Self.Iterator.Element? { get }</code>

        <h4>Declared In</h4>
            <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>
        ,    <a href="../../protocol/Collection/"><code>Collection</code></a>
        </div></div>
</div>


<div class="declaration inherited" id="func-index_-bidirectionalindex-droplast_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-index_-bidirectionalindex-droplast_">func dropLast(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-index_-bidirectionalindex-droplast_"><div class="p">
    <p>Returns a subsequence containing all but the last <code>n</code> elements.</p>

<p><strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>n</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropLast(n: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-index_-bidirectionalindex-removelast">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-index_-bidirectionalindex-removelast">mutating func removeLast()</a>
        
<div class="comment collapse" id="comment-func-index_-bidirectionalindex-removelast"><div class="p">
    <p>Remove an element from the end.</p>

<p><strong>Complexity:</strong> O(1)
<strong>Precondition:</strong> <code>!self.isEmpty</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeLast() -&gt; Self.Iterator.Element</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-index_-bidirectionalindex-removelast_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-index_-bidirectionalindex-removelast_">mutating func removeLast(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-index_-bidirectionalindex-removelast_"><div class="p">
    <p>Remove the last <code>n</code> elements.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>)
<strong>Precondition:</strong> <code>n &gt;= 0 &amp;&amp; self.count &gt;= n</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeLast(n: Int)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-index_-bidirectionalindex-reversed">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-index_-bidirectionalindex-reversed">func reversed()</a>
        
<div class="comment collapse" id="comment-func-index_-bidirectionalindex-reversed"><div class="p">
    <p>Returns the elements of <code>self</code> in reverse order.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func reversed() -&gt; ReverseCollection&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-index_-bidirectionalindex-suffix_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-index_-bidirectionalindex-suffix_">func suffix(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-index_-bidirectionalindex-suffix_"><div class="p">
    <p>Returns a slice, up to <code>maxLength</code> in length, containing the
final elements of <code>self</code>.</p>

<p>If <code>maxLength</code> exceeds <code>s.count</code>, the result contains all
the elements of <code>self</code>.</p>

<p><strong>Precondition:</strong> <code>maxLength &gt;= 0</code>
<strong>Complexity:</strong> O(<code>maxLength</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func suffix(maxLength: Int) -&gt; Self.SubSequence</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>





<h4>Where Index : RandomAccessIndex</h4>




<div class="declaration inherited" id="func-index_-randomaccessindex-reversed">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-index_-randomaccessindex-reversed">func reversed()</a>
        
<div class="comment collapse" id="comment-func-index_-randomaccessindex-reversed"><div class="p">
    <p>Returns the elements of <code>self</code> in reverse order.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func reversed() -&gt; ReverseRandomAccessCollection&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>





<h4>Where Iterator == IndexingIterator<Self></h4>




<div class="declaration inherited" id="func-iterator-indexingiterator-self-makeiterator">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-indexingiterator-self-makeiterator">func makeIterator()</a>
        
<div class="comment collapse" id="comment-func-iterator-indexingiterator-self-makeiterator"><div class="p">
    <p>Supply the default <code>makeIterator()</code> method for <code>Collection</code> models
that accept the default associated <code>Iterator</code>,
<code>IndexingIterator&lt;Self&gt;</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func makeIterator() -&gt; IndexingIterator&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>





<h4>Where Iterator == Self, Self : IteratorProtocol</h4>




<div class="declaration inherited" id="func-iterator-self-self_-iteratorprotocol-makeiterator">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-self-self_-iteratorprotocol-makeiterator">func makeIterator()</a>
        
<div class="comment collapse" id="comment-func-iterator-self-self_-iteratorprotocol-makeiterator"><div class="p">
    <p>A default makeIterator() function for <code>IteratorProtocol</code> instances that
are declared to conform to <code>Sequence</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func makeIterator() -&gt; Self</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>





<h4>Where Iterator.Element : Collection</h4>




<div class="declaration inherited" id="func-iterator-element_-collection-flatten">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-collection-flatten">func flatten()</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-collection-flatten"><div class="p">
    <p>A concatenation of the elements of <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func flatten() -&gt; FlattenCollection&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>





<h4>Where Iterator.Element : Collection, Index : BidirectionalIndex, Iterator.Element.Index : BidirectionalIndex</h4>




<div class="declaration inherited" id="func-iterator-element_-collection-index_-bidirectionalindex-iterator-element-index_-bidirectionalindex-flatten">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-collection-index_-bidirectionalindex-iterator-element-index_-bidirectionalindex-flatten">func flatten()</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-collection-index_-bidirectionalindex-iterator-element-index_-bidirectionalindex-flatten"><div class="p">
    <p>A concatenation of the elements of <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func flatten() -&gt; FlattenBidirectionalCollection&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>





<h4>Where Iterator.Element : Comparable</h4>




<div class="declaration inherited" id="func-iterator-element_-comparable-lexicographicallyprecedes_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-comparable-lexicographicallyprecedes_">func lexicographicallyPrecedes(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-comparable-lexicographicallyprecedes_"><div class="p">
    <p>Returns <code>true</code> iff <code>self</code> precedes <code>other</code> in a lexicographical
(&quot;dictionary&quot;) ordering, using &quot;&lt;&quot; as the comparison between elements.</p>

<p><strong>Note:</strong> This method implements the mathematical notion of lexicographical
  ordering, which has no connection to Unicode.  If you are sorting strings
  to present to the end-user, you should use <code>String</code> APIs that perform
localized comparison.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func lexicographicallyPrecedes&lt;OtherSequence : Sequence where OtherSequence.Iterator.Element == Iterator.Element&gt;(other: OtherSequence) -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-comparable-max">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-comparable-max">func max()</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-comparable-max"><div class="p">
    <p>Returns the maximum element in <code>self</code> or <code>nil</code> if the sequence is empty.</p>

<p><strong>Complexity:</strong> O(<code>elements.count</code>).
  </p>

    <h4>Declaration</h4>    
    <code class="language-swift">func max() -&gt; Self.Iterator.Element?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-comparable-min">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-comparable-min">func min()</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-comparable-min"><div class="p">
    <p>Returns the minimum element in <code>self</code> or <code>nil</code> if the sequence is empty.</p>

<p><strong>Complexity:</strong> O(<code>elements.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func min() -&gt; Self.Iterator.Element?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-comparable-sorted">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-comparable-sorted">func sorted()</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-comparable-sorted"><div class="p">
    <p>Returns an <code>Array</code> containing the sorted elements of <code>source</code>.</p>

<p>The sorting algorithm is not stable (can change the relative order of
elements that compare equal).</p>

<p><strong>Precondition:</strong> The less-than operator (<code>func &lt;</code>) defined in
  the <code>Comparable</code> conformance is a
  <a href="http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings">strict weak ordering</a>
  over the elements in <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func sorted() -&gt; [Self.Iterator.Element]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>





<h4>Where Iterator.Element : Equatable</h4>




<div class="declaration inherited" id="func-iterator-element_-equatable-contains_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-equatable-contains_">func contains(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-equatable-contains_"><div class="p">
    <p>Returns <code>true</code> iff <code>element</code> is in <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func contains(element: Self.Iterator.Element) -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-equatable-elementsequal_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-equatable-elementsequal_">func elementsEqual(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-equatable-elementsequal_"><div class="p">
    <p>Returns <code>true</code> iff <code>self</code> and <code>other</code> contain the same elements in the
same order.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func elementsEqual&lt;OtherSequence : Sequence where OtherSequence.Iterator.Element == Iterator.Element&gt;(other: OtherSequence) -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-equatable-index-of_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-equatable-index-of_">func index(<wbr>of:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-equatable-index-of_"><div class="p">
    <p>Returns the first index where <code>value</code> appears in <code>self</code> or <code>nil</code> if
<code>value</code> is not found.</p>

<p><strong>Complexity:</strong> O(<code>self.count</code>).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func index(of element: Self.Iterator.Element) -&gt; Self.Index?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-equatable-split-separator_maxsplits_omittingemptysubsequences_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-equatable-split-separator_maxsplits_omittingemptysubsequences_">func split(<wbr>separator:<wbr>maxSplits:<wbr>omittingEmptySubsequences:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-equatable-split-separator_maxsplits_omittingemptysubsequences_"><div class="p">
    <p>Returns the maximal <code>SubSequence</code>s of <code>self</code>, in order, around a
<code>separator</code> element.</p>

<p><strong><code>maxSplits</code>:</strong>  The maximum number of <code>SubSequence</code>s to
  return, minus 1.
  If <code>maxSplits + 1</code> <code>SubSequence</code>s are returned, the last one is
  a suffix of <code>self</code> containing <em>all</em> the elements of <code>self</code> following the
  last split point.
  The default value is <code>Int.max</code>.</p>

<p><strong><code>omittingEmptySubsequences</code>:</strong>  If <code>false</code>, an empty <code>SubSequence</code>
  is produced in the result for each pair of consecutive elements
  equal to <code>separator</code>.
  The default value is <code>true</code>.</p>

<p><strong>Precondition:</strong> <code>maxSplits &gt;= 0</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func split(separator separator: Self.Iterator.Element, maxSplits: Int = default, omittingEmptySubsequences: Bool = default) -&gt; [Self.SubSequence]</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-equatable-starts-with_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-equatable-starts-with_">func starts(<wbr>with:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-equatable-starts-with_"><div class="p">
    <p>Returns <code>true</code> iff the initial elements of <code>self</code> are equal to <code>prefix</code>.
Returns <code>true</code> if <code>other</code> is empty.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func starts&lt;PossiblePrefix : Sequence where PossiblePrefix.Iterator.Element == Iterator.Element&gt;(with possiblePrefix: PossiblePrefix) -&gt; Bool</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>





<h4>Where Iterator.Element : Sequence</h4>




<div class="declaration inherited" id="func-iterator-element_-sequence-flatten">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-sequence-flatten">func flatten()</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-sequence-flatten"><div class="p">
    <p>A concatenation of the elements of <code>self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func flatten() -&gt; FlattenSequence&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-iterator-element_-sequence-joined-separator_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element_-sequence-joined-separator_">func joined(<wbr>separator:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element_-sequence-joined-separator_"><div class="p">
    <p>Returns a view, whose elements are the result of interposing a given
<code>separator</code> between the elements of the sequence <code>self</code>.</p>

<p>For example,
<code>[[1, 2, 3], [4, 5, 6], [7, 8, 9]].joined(separator: [-1, -2])</code>
yields <code>[1, 2, 3, -1, -2, 4, 5, 6, -1, -2, 7, 8, 9]</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func joined&lt;Separator : Sequence where Separator.Iterator.Element == Iterator.Element.Iterator.Element&gt;(separator separator: Separator) -&gt; JoinedSequence&lt;Self&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>





<h4>Where Iterator.Element == String</h4>




<div class="declaration inherited" id="func-iterator-element-string-joined-separator_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-iterator-element-string-joined-separator_">func joined(<wbr>separator:)</a>
        
<div class="comment collapse" id="comment-func-iterator-element-string-joined-separator_"><div class="p">
    <p>Interpose the <code>separator</code> between elements of <code>self</code>, then concatenate
the result.  For example:</p>

<pre><code class="language-swift">[&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;].joined(separator: &quot;-|-&quot;) // &quot;foo-|-bar-|-baz&quot;</code></pre>

    <h4>Declaration</h4>    
    <code class="language-swift">func joined(separator separator: String) -&gt; String</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>





<h4>Where SubSequence : Sequence, SubSequence.Iterator.Element == Iterator.Element, SubSequence.SubSequence == SubSequence</h4>




<div class="declaration inherited" id="func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-dropfirst_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-dropfirst_">func dropFirst(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-dropfirst_"><div class="p">
    <p>Returns a subsequence containing all but the first <code>n</code> elements.</p>

<p><strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>n</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropFirst(n: Int) -&gt; AnySequence&lt;Self.Iterator.Element&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-droplast_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-droplast_">func dropLast(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-droplast_"><div class="p">
    <p>Returns a subsequence containing all but the last <code>n</code> elements.</p>

<p><strong>Precondition:</strong> <code>self</code> is a finite collection.
<strong>Precondition:</strong> <code>n &gt;= 0</code>
<strong>Complexity:</strong> O(<code>self.count</code>)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func dropLast(n: Int) -&gt; AnySequence&lt;Self.Iterator.Element&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-prefix_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-prefix_">func prefix(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-subsequence_-sequence-subsequence-iterator-element-iterator-element-subsequence-subsequence-subsequence-prefix_"><div class="p">
    <p>Returns a subsequence, up to <code>maxLength</code> in length, containing the
initial elements.</p>

<p>If <code>maxLength</code> exceeds <code>self.count</code>, the result contains all
the elements of <code>self</code>.</p>

<p><strong>Precondition:</strong> <code>maxLength &gt;= 0</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func prefix(maxLength: Int) -&gt; AnySequence&lt;Self.Iterator.Element&gt;</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>,    <a href="../../protocol/Sequence/"><code>Sequence</code></a>    
</div></div>
</div>





<h4>Where SubSequence == Self</h4>




<div class="declaration inherited" id="func-subsequence-self-popfirst">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence-self-popfirst">mutating func popFirst()</a>
        
<div class="comment collapse" id="comment-func-subsequence-self-popfirst"><div class="p">
    <p>If <code>!self.isEmpty</code>, remove the first element and return it, otherwise
return <code>nil</code>.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func popFirst() -&gt; Self.Iterator.Element?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-subsequence-self-removefirst">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence-self-removefirst">mutating func removeFirst()</a>
        
<div class="comment collapse" id="comment-func-subsequence-self-removefirst"><div class="p">
    <p>Remove the element at <code>startIndex</code> and return it.</p>

<p><strong>Complexity:</strong> O(1)
<strong>Precondition:</strong> <code>!self.isEmpty</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeFirst() -&gt; Self.Iterator.Element</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-subsequence-self-removefirst_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence-self-removefirst_">mutating func removeFirst(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-subsequence-self-removefirst_"><div class="p">
    <p>Remove the first <code>n</code> elements.</p>

<p><strong>Complexity:</strong> O(1)
<strong>Precondition:</strong> <code>self.count &gt;= n</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeFirst(n: Int)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>





<h4>Where SubSequence == Self, Index : BidirectionalIndex</h4>




<div class="declaration inherited" id="func-subsequence-self-index_-bidirectionalindex-poplast">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence-self-index_-bidirectionalindex-poplast">mutating func popLast()</a>
        
<div class="comment collapse" id="comment-func-subsequence-self-index_-bidirectionalindex-poplast"><div class="p">
    <p>If <code>!self.isEmpty</code>, remove the last element and return it, otherwise
return <code>nil</code>.</p>

<p><strong>Complexity:</strong> O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func popLast() -&gt; Self.Iterator.Element?</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-subsequence-self-index_-bidirectionalindex-removelast">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence-self-index_-bidirectionalindex-removelast">mutating func removeLast()</a>
        
<div class="comment collapse" id="comment-func-subsequence-self-index_-bidirectionalindex-removelast"><div class="p">
    <p>Remove an element from the end.</p>

<p><strong>Complexity:</strong> O(1)
<strong>Precondition:</strong> <code>!self.isEmpty</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeLast() -&gt; Self.Iterator.Element</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>
<div class="declaration inherited" id="func-subsequence-self-index_-bidirectionalindex-removelast_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-subsequence-self-index_-bidirectionalindex-removelast_">mutating func removeLast(<wbr>_:)</a>
        
<div class="comment collapse" id="comment-func-subsequence-self-index_-bidirectionalindex-removelast_"><div class="p">
    <p>Remove the last <code>n</code> elements.</p>

<p><strong>Complexity:</strong>
  - O(1) if <code>Index</code> conforms to <code>RandomAccessIndex</code>
  - O(n) otherwise
<strong>Precondition:</strong> <code>n &gt;= 0 &amp;&amp; self.count &gt;= n</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func removeLast(n: Int)</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>





<h4>Where SubSequence == Slice<Self></h4>



<div class="declaration inherited" id="subscript-subsequence-slice-self-subscript_-range-self-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-subscript-subsequence-slice-self-subscript_-range-self-index">subscript(_: Range&lt;Self.Index&gt;)</a>
<div class="comment collapse" id="comment-subscript-subsequence-slice-self-subscript_-range-self-index"><div class="p">
    <p>Supply the default &quot;slicing&quot; <code>subscript</code>  for <code>Collection</code> models
that accept the default associated <code>SubSequence</code>, <code>Slice&lt;Self&gt;</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">subscript(bounds: Range&lt;Self.Index&gt;) -&gt; Slice&lt;Self&gt; { get }</code>
    
        <h4>Declared In</h4>
        <a href="../../protocol/RangeReplaceableCollection/"><code>RangeReplaceableCollection</code></a>,    <a href="../../protocol/Collection/"><code>Collection</code></a>    
</div></div>
</div>




